<?php if (count($albums) > 0):
$album = array_shift($albums);
$highlight = $flickr->getPhotoSizes($album['primary']);
$photos = $flickr->getPhotos($album['id']);
?>
<div id="highlight">

<h2><a href="album/<?php echo $album['id']?>/<?php echo $album['pagename']?>"><?php echo $album['title']?></a></h2>
<a 
    <?php if ($SilasFlickrPlugin->config['useLightbox']):?>
    rel="lightbox[album]" href="<?php echo $highlight['Medium']['source']?>"
    <?php else:?>
    href="album/<?php echo $album['id']?>/<?php echo $album['pagename']?>"
    <?php endif;?>
    title="<?php echo htmlentities($photos[$album['primary']]['title'] . strip_tags($photos[$album['primary']]['description'] ? ' - '.$photos[$album['primary']]['description'] : '')) ?>"><img class="highlight" src="<?php echo $highlight['Small']['source']?>" width="<?php echo round($highlight['Small']['width']/2)?>" height="<?php echo round($highlight['Small']['height']/2)?>" alt="" /></a>
<p><?php echo html_entity_decode($album['description'])?></p>
<p class="meta">
    <?php echo $album['photos']?> Photos | 
    <a href="album/<?php echo $album['id']?>/<?php echo $album['pagename']?>" onclick="return openSlideShow('<?php echo $album['id']?>')">View as slideshow &gt;</a>
</p>

<div class="photos">
    <?php foreach ($photos as $photo):?>
        <a
            <?php if ($SilasFlickrPlugin->config['useLightbox']):?>
            rel="lightbox[album]" href="<?php echo $photo['sizes']['Medium']['source']?>"
            <?php else:?>
            href="album/<?php echo $album['id']?>/photo/<?php echo $photo['id']?>/<?php echo $album['pagename2'] .'-'. $photo['pagename']?>"
            <?php endif;?>
            title="<?php echo htmlentities($photo['title'] . strip_tags($photo['description'] ? ' - '.$photo['description'] : ''))?>"><img 
            src="<?php echo $photo['sizes']['Square']['source']?>" width="<?php echo round($photo['sizes']['Square']['width']/2)?>" height="<?php echo round($photo['sizes']['Square']['height']/2)?>" 
            alt="<?php echo htmlentities($photo['title'])?>" /></a>
    <?php endforeach?>
</div>


</div>
<?php endif; ?>
